#pragma once

#include "LookFeelPanel.h"
#include "LookFeelProperty.h"
#include "LookFeelSkinEd.h"

class LookFeelEditor
{
	DECLARE_SINGLETON(LookFeelEditor);

public:
	tEvent1<MGUI_LookFeel *> eventEditLookFeelChanged;
	tEvent1<Texture *> eventEditSkinChanged;
	tEvent1<MGUI_Rect> eventEditRectChanged;
	tEvent1<MGUI_ClientRect> eventEditClientChanged;
	tEvent0 eventNameChanged;

public:
	LookFeelEditor();
	~LookFeelEditor();

	void Layout();

	void Save();

	void SetEditLookFeel(MGUI_LookFeel * _lookfeel);
	MGUI_LookFeel * GetEditLookFeel();

	int GetEditWidgetType();

	void _notifyNameChanged();
	void _notifyRectChanged(const MGUI_Rect & _rect);
	void _notifyClientChanged(const MGUI_ClientRect & _rect);
	void _notifySkinChanged(Texture * _skin);

protected:
	LookFeelPanel * mLookFeelPanel;
	LookFeelProperty * mLookFeelProperty;
	LookFeelSkinEd * mLookFeelSkinEd;

	MGUI_LookFeel * mEditLookFeel;
	Texture * mEditSkin;
	MGUI_Rect mEditRect;

protected:
	void OnEditorModeChanged_(eEditorMode _mode);

	tListener1<LookFeelEditor, eEditorMode> OnEditorModeChanged;
};

